import { request } from '@pkg/request/src';

export enum Api {
  page = '/wechat/page',
  list = '/wechat/list',
  get = '/wechat/get',
  add = '/wechat/save',
  update = '/wechat/update',
  remove = '/wechat/remove',
  updateMemberCard = '/wechat/updateMemberCard',
  copyWechatDataToMiniWechat = '/wechat/copyWechatDataToMiniWechat',
  copyGoodsWechatData = '/wechat/copyGoodsWechatData',
}

export const weChatList = () => request.get({ url: Api.list }, { errorMessageMode: 'none', successMessageMode: 'none' });

export const updateMemberCard = params =>
  request.post(
    {
      url: Api.updateMemberCard,
      params: params,
    },
    { errorMessageMode: 'message', successMessageMode: 'success' },
  );
export const copyWechatDataToMiniWechat = params =>
  request.post(
    {
      url: Api.copyWechatDataToMiniWechat,
      params: params,
    },
    { errorMessageMode: 'message', successMessageMode: 'success' },
  );
export const copyGoodsWechatData = params =>
  request.post(
    {
      url: Api.copyGoodsWechatData,
      params: params,
    },
    { errorMessageMode: 'message', successMessageMode: 'success' },
  );
